from pydantic import BaseModel
from datetime import datetime
from typing import Optional

# 创建好友关系的输入模型
class FriendshipCreate(BaseModel):
    user_id: int  # 主动添加者ID
    friend_id: int  # 被添加者ID

# 好友关系的返回模型
class Friendship(FriendshipCreate):
    id: int
    created_at: datetime

    class Config:
        from_attributes = True
